home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / wanderer / patch1 < prev    next >
Encoding:
Text File  |  1988-11-30  |  43.6 KB  |  1,501 lines

  1.   OK, here's the *official* diffs to update Wanderer V2.0(M) to V2.2(M).
  2. (Please don't ask what happened to version 2.1 ...). The sharfile contains
  3. a file of diffs for most of the source files, a new file encrypt.c, a few more
  4. screens and a README file explaining all the alterations.
  5.  
  6.   Changes include a number of small -> large bugfixes, extra facilities -
  7. eg refresh screen, swap between modes, center screen, more help - , a fix for
  8. the 'stunned' baby monsters ( those moving in small circles ) and also the
  9. addition of 'balloons' to the game ( see screen.23 ). All of the changes
  10. are documented in the README file.
  11.  
  12.   -Steven Shipway
  13.  
  14. maujp@uk.ac.warwick.cu  ( in preference )
  15. csupt@uk.ac.warwick.cu
  16. ...!mcvax!ukc!warwick!{maujp,csupt}
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of shell archive."
  25. # Contents:  README2.2 credits encrypt.c patches01 screen.16 screen.21
  26. #   screen.22 screen.23
  27. # Wrapped by billr@saab on Tue Nov 29 17:01:57 1988
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'README2.2' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'README2.2'\"
  31. else
  32. echo shar: Extracting \"'README2.2'\" \(1522 characters\)
  33. sed "s/^X//" >'README2.2' <<'END_OF_FILE'
  34. XOK, here are the major alterations:
  35. X
  36. X1)  Unless NO_ENCRYPTION has been #def'd then saved games are encrypted.
  37. X    This means an extra source file.
  38. X2)  Lots of cosmetic changes, tidying up messy displaying.
  39. X3)  Extra keys:
  40. X        In Game -   @ --- moves you to center of screen
  41. X                    # --- toggle between normal and fullscreen
  42. X                    W --- redraw screen
  43. X        In Editor - x --- quit edit without saving
  44. X4)  (BIG CHANGE) New object - balloons. These fall up, and are popped by
  45. X   arrows. Also, they kill neither you nor the monster. I havent made any
  46. X   screens involving these, though - maybe you can design a few?
  47. X5)  Help file extended to include info about environment variables, new
  48. X   keys and features.
  49. X6)  Baby monsters can no longer be 'stunned' - trapped in tiny circles -
  50. X   unless you try very hard to get them that way....
  51. X    This cures a bug that Ive been thinking about for ages, and also makes
  52. X   screen 18 a bit easier.
  53. X7)  The -e flag (enter editor) can now take an optional argument. If given,
  54. X   it will take this as the file to be edited. eg, 'wanderer -e screen.1'
  55. X   will edit the file 'screen.1' instead of 'screen' (the default).
  56. X8)  You can no longer sneak off the top of some screens (apparently this
  57. X   is possible on some systems)
  58. X9)  Bug in editor that caused the problem on one of the screens has been
  59. X   fixed.
  60. X
  61. XAlso, there should be a few extra screens and a new credits file in here.
  62. X
  63. X-Steve
  64. X{maujp,csupt}@uk.ac.warwick.cu
  65. X...!mcvax!ukc!warwick!{maujp,csupt}
  66. END_OF_FILE
  67. if test 1522 -ne `wc -c <'README2.2'`; then
  68.     echo shar: \"'README2.2'\" unpacked with wrong size!
  69. fi
  70. # end of 'README2.2'
  71. fi
  72. if test -f 'credits' -a "${1}" != "-c" ; then 
  73.   echo shar: Will not clobber existing file \"'credits'\"
  74. else
  75. echo shar: Extracting \"'credits'\" \(2686 characters\)
  76. sed "s/^X//" >'credits' <<'END_OF_FILE'
  77. X                            WANDERER CREDITS
  78. X                           ==================
  79. X
  80. XThis file should always be available to all players of the game. Feel free to
  81. Xadd anything necessary, eg, if you create some new screens, but don't *delete*
  82. Xanything! -Steven Shipway
  83. X
  84. X-----------------------------------------------------------------------------
  85. X
  86. X        Wanderer was created by Steven Shipway, a first year mathematics
  87. Xstudent at Warwick University, England.  The idea came from games such as
  88. XBoulderdash, Xor, and especially Repton, from Superior Software. (plug, plug)
  89. X
  90. X        Later improvements came from play@nl.cwi, who designed the editor
  91. Xand made countless bugfixes, of which there are too many to list here. He
  92. Xalso improved many parts of the original code, and also designed some
  93. Xscreens. Also Dave (david@ist.co.uk), who did most of the work towards the
  94. Ximproved level jumping routine (sorry, I had to alter it a bit due to other
  95. Xchanges). Jason (jason@uucp.aeras) is responsible for the help routine, for
  96. Xwhich I am eternally grateful since it saved me a lot of work.
  97. X
  98. X        Assisting in the development were Rob McMahon (our systems manager)
  99. Xand Mark Sunnarks. In screen development were the following:
  100. X
  101. XScreens 1,2,3,4,7,8,10,16,23  Steven Shipway (although some of them are AWFUL)
  102. XScreens 5,6             csutg@uk.ac.warwick.cu (far more evil than mine)
  103. XScreen  9               maukr@uk.ac.warwick.cu (also the old bugged screen 13)
  104. XScreens 11,13,14,19,20  play@nl.cwi    (who wishes to remain nameless to avoid
  105. X                                        the netherlands mafia :-)
  106. XScreen  17              david@ist.co.uk  (sorry, I dont know your full name)
  107. XScreen  15              bruce@au.oz.utas.tasis (from Down Under)
  108. XScreen  18                   ''           (relation, age 10)
  109. XScreens 21,22           jn@uk.ac.ukc   (who created the archimedes port)
  110. X
  111. XAny new screens you wish to have added to the list please mail to me for
  112. Xrelease in a official update package. The address is
  113. X{maujp,csupt}@uk.ac.warwick.cu or ...!mcvax!ukc!warwick!{maujp,csupt}.
  114. X
  115. XThe official PC Port for Wanderer was done by Greg Margo, who may be found at
  116. Xgmago@uucp.netxcom or uunet!netxcom!gmargo.
  117. X
  118. XThe X-Windows port - which is pretty impressive - comes from Mike Cuddy.
  119. XHis address is cuddy%convex@edu.umich.cc.umix or ihnp4!convex!cuddy. Although
  120. XI haven't been able to see this one for myself a friend assures me that the
  121. Xgraphics are fantastic.
  122. X
  123. XThe Acorn Archimedes port was done by Max Rockatansky, jn@uk.ac.ukc . Mail him
  124. Xif you want a copy.
  125. X
  126. XAlso thanks to Paul Metcalf for thinking of a name for the game!
  127. X
  128. XIf you missed some of this, try again with 'wanderer -c | more' .
  129. END_OF_FILE
  130. if test 2686 -ne `wc -c <'credits'`; then
  131.     echo shar: \"'credits'\" unpacked with wrong size!
  132. fi
  133. # end of 'credits'
  134. fi
  135. if test -f 'encrypt.c' -a "${1}" != "-c" ; then 
  136.   echo shar: Will not clobber existing file \"'encrypt.c'\"
  137. else
  138. echo shar: Extracting \"'encrypt.c'\" \(1173 characters\)
  139. sed "s/^X//" >'encrypt.c' <<'END_OF_FILE'
  140. X#include "wand_head.h"
  141. X
  142. X/* Uses seeded random xor to encrypt because setkey doesnt work on our
  143. X   system.                                 */
  144. X
  145. X/* this is the randon number seed */
  146. X#define BLURFL 32451    /* the word blurfl is used for historical reasons */
  147. X                        /* but it can be any nuber */
  148. Xcrypt_file(name)
  149. Xchar *name;
  150. X{
  151. Xchar buffer[1024];
  152. Xint fd,length,loop;
  153. X
  154. Xif((fd = open(name,O_RDONLY)) == -1) {
  155. X    endwin();
  156. X    sprintf(buffer,"Wanderer: cannot open %s",name);
  157. X    perror(buffer);
  158. X    exit(1);
  159. X}
  160. Xif((length = read(fd,buffer,1024)) < 1) {
  161. X    endwin();
  162. X    sprintf(buffer,"Wanderer: read error on %s",name);
  163. X    perror(buffer);
  164. X    exit(1);
  165. X}
  166. Xclose(fd);
  167. X
  168. X/* Right, got it in here, now to encrypt the stuff */
  169. X
  170. Xaddstr("Running crypt routine...\n");
  171. Xrefresh();
  172. X
  173. Xsrand(BLURFL);
  174. Xfor(loop=0;loop<length;loop++)
  175. X    buffer[loop]^=rand();
  176. X
  177. Xif((fd = open(name,O_WRONLY|O_TRUNC))== -1) {
  178. X    endwin();
  179. X    sprintf(buffer,"Wanderer: cannot write to %s",name);
  180. X    perror(buffer);
  181. X    exit(1);
  182. X}
  183. Xif(write(fd,buffer,length)!=length) {
  184. X    endwin();
  185. X    sprintf(buffer,"Wanderer: write error on %s",name);
  186. X    perror(buffer);
  187. X    exit(1);
  188. X}
  189. Xclose(fd);
  190. X
  191. X/* ok, file now contains encrypted/decrypted game. */
  192. X/* lets go back home... */
  193. X}
  194. END_OF_FILE
  195. if test 1173 -ne `wc -c <'encrypt.c'`; then
  196.     echo shar: \"'encrypt.c'\" unpacked with wrong size!
  197. fi
  198. # end of 'encrypt.c'
  199. fi
  200. if test -f 'patches01' -a "${1}" != "-c" ; then 
  201.   echo shar: Will not clobber existing file \"'patches01'\"
  202. else
  203. echo shar: Extracting \"'patches01'\" \(30930 characters\)
  204. sed "s/^X//" >'patches01' <<'END_OF_FILE'
  205. X*** Makefile.orig    Tue Nov 29 16:43:18 1988
  206. X--- Makefile    Tue Nov 29 16:44:07 1988
  207. X***************
  208. X*** 2,8 ****
  209. X  # modified again by play@cwi.nl
  210. X  # and again by me.. maujp@uk.ac.warwick.cu
  211. X  
  212. X! OBJ = m.o save.o jump.o display.o icon.o game.o read.o help.o fall.o scores.o edit.o
  213. X  
  214. X  CFLAGS = -O
  215. X  LIBS = -lcurses -ltermcap
  216. X--- 2,8 ----
  217. X  # modified again by play@cwi.nl
  218. X  # and again by me.. maujp@uk.ac.warwick.cu
  219. X  
  220. X! OBJ = m.o save.o jump.o display.o icon.o game.o read.o help.o fall.o scores.o edit.o encrypt.o
  221. X  
  222. X  CFLAGS = -O
  223. X  LIBS = -lcurses -ltermcap
  224. X*** display.c.orig    Tue Nov 29 16:43:20 1988
  225. X--- display.c    Tue Nov 29 16:44:16 1988
  226. X***************
  227. X*** 26,35 ****
  228. X          addch(ch);
  229. X          }
  230. X      else
  231. X!         if(ch==' '||ch=='#'||ch=='<'||ch=='>'||ch=='O'||ch==':'||
  232. X             ch=='/'||ch=='\\'||ch=='*'||ch=='='||ch=='@'||ch=='T'||
  233. X             ch=='X'||ch=='!'||ch=='M'||ch=='S'||ch=='C'||ch=='+'||
  234. X!            ch=='A')
  235. X          addch(ch);
  236. X          else
  237. X          addch('"');
  238. X--- 26,35 ----
  239. X          addch(ch);
  240. X          }
  241. X      else
  242. X!             if(ch==' '||ch=='#'||ch=='<'||ch=='>'||ch=='O'||ch==':'||
  243. X             ch=='/'||ch=='\\'||ch=='*'||ch=='='||ch=='@'||ch=='T'||
  244. X             ch=='X'||ch=='!'||ch=='M'||ch=='S'||ch=='C'||ch=='+'||
  245. X!                ch=='A'||ch=='^')
  246. X          addch(ch);
  247. X          else
  248. X          addch('"');
  249. X***************
  250. X*** 114,117 ****
  251. X--- 114,151 ----
  252. X      }                       /* end y loop */
  253. X      move(16,0);
  254. X      refresh();
  255. X+ }
  256. X+ void redraw_screen(maxmoves,num,score,nf,diamonds,mx,sx,sy,frow)
  257. X+ int maxmoves,num,score,nf,diamonds,mx,sx,sy;
  258. X+ char **frow;
  259. X+ {
  260. X+ char buffer[50];
  261. X+ clear();
  262. X+ move(0,48);
  263. X+ (void) addstr("Score\t   Diamonds");
  264. X+ move(1,48);
  265. X+ (void) addstr("\tFound\tTotal");
  266. X+ move(3,48);
  267. X+ (void) sprintf(buffer,"%d\t %d\t %d  ",score,nf,diamonds);
  268. X+ (void) addstr(buffer);
  269. X+ move(6,48);
  270. X+ (void) sprintf(buffer,"Current screen %d",num);
  271. X+ (void) addstr(buffer);
  272. X+ if(maxmoves != 0)
  273. X+ (void) sprintf(buffer,"Moves remaining = %d   ",maxmoves);
  274. X+ else
  275. X+ {
  276. X+     (void) strcpy(buffer,"     Unlimited moves     ");
  277. X+     maxmoves = -1;
  278. X+ };
  279. X+ move(15,48);
  280. X+ (void) addstr(buffer);
  281. X+ if(mx != -1)                            /* tell player if monster exists */
  282. X+     draw_symbol(48,10,'M');
  283. X+ else
  284. X+     draw_symbol(48,10,' ');
  285. X+ if(!debug_disp)
  286. X+     display(sx,sy,frow,score);
  287. X+ else
  288. X+     map(frow);
  289. X  }
  290. X*** edit.c.orig    Tue Nov 29 16:43:08 1988
  291. X--- edit.c    Tue Nov 29 16:44:20 1988
  292. X***************
  293. X*** 3,15 ****
  294. X  extern char *playscreen();
  295. X  
  296. X  extern int debug_disp;
  297. X  extern char screen[NOOFROWS][ROWLEN+1];
  298. X  
  299. X- /* Print instructions around the screen */
  300. X- void instruct()
  301. X- {
  302. X  static char *inst[] = { "O   Boulder",
  303. X              "< > Arrows",
  304. X              ":   Earth",
  305. X              "!   Landmine",
  306. X              "*   Treasure",
  307. X--- 3,14 ----
  308. X  extern char *playscreen();
  309. X  
  310. X  extern int debug_disp;
  311. X+ extern char *edit_screen;
  312. X  extern char screen[NOOFROWS][ROWLEN+1];
  313. X  
  314. X  static char *inst[] = { "O   Boulder",
  315. X              "< > Arrows",
  316. X+             "^   Balloon",
  317. X              ":   Earth",
  318. X              "!   Landmine",
  319. X              "*   Treasure",
  320. X***************
  321. X*** 16,22 ****
  322. X              "/ \\ Deflectors",
  323. X              "+   Cage",
  324. X              "= # Rock",
  325. X!             "T   Teleport (1 max)",
  326. X              "A   Arrival (1 max)",
  327. X              "X   Exit (always 1)",
  328. X              "@   Start (always 1)",
  329. X--- 15,21 ----
  330. X              "/ \\ Deflectors",
  331. X              "+   Cage",
  332. X              "= # Rock",
  333. X!             "T   Teleport",
  334. X              "A   Arrival (1 max)",
  335. X              "X   Exit (always 1)",
  336. X              "@   Start (always 1)",
  337. X***************
  338. X*** 23,48 ****
  339. X              "M   Big Monster (1 max)",
  340. X              "S   Baby Monster",
  341. X              "-   Alternative space",
  342. X!             "C   Time Capsule" };
  343. X  int loop;
  344. X! for(loop = 1;loop < 17; loop++)
  345. X      {
  346. X!     move(loop,55);
  347. X!     addstr(inst[loop-1]);
  348. X      }
  349. X! move(21,0);
  350. X! addstr("Use wanderer keys to move. q = quit, p/n = play, m = change no. of moves.");
  351. X  }
  352. X  
  353. X  void noins()
  354. X  {
  355. X  int loop;
  356. X! for(loop =1;loop < 17; loop++)
  357. X      {
  358. X!     move(loop,55);
  359. X      addstr("                       ");
  360. X      }
  361. X! move(21,0);
  362. X  addstr("                                                                            ");
  363. X  }
  364. X  
  365. X--- 22,53 ----
  366. X              "M   Big Monster (1 max)",
  367. X              "S   Baby Monster",
  368. X              "-   Alternative space",
  369. X!             "C   Time Capsule",
  370. X!             NULL };
  371. X! /* Print instructions around the screen */
  372. X! void instruct()
  373. X! {
  374. X  int loop;
  375. X! for(loop = 0; inst[loop] ; loop++)
  376. X      {
  377. X!     move(loop+1,55);
  378. X!     addstr(inst[loop]);
  379. X      }
  380. X! move(20,0);
  381. X! addstr("Use wanderer keys to move. m = change no. of moves, p = play game\n");
  382. X! addstr("n = play game with full screen, q = quit, x = quit without save.");
  383. X  }
  384. X  
  385. X  void noins()
  386. X  {
  387. X  int loop;
  388. X! for(loop =0; inst[loop] ; loop++)
  389. X      {
  390. X!     move(loop+1,55);
  391. X      addstr("                       ");
  392. X      }
  393. X! move(20,0);
  394. X! addstr("                                                                            \n");
  395. X  addstr("                                                                            ");
  396. X  }
  397. X  
  398. X***************
  399. X*** 54,60 ****
  400. X       *score;
  401. X  char keys[10];
  402. X  {
  403. X! int  x,y,sx=0,sy=0,quit=0,nx,ny;
  404. X  char (*frow)[ROWLEN+1] = screen,
  405. X       ch;
  406. X  char buffer[50];
  407. X--- 59,65 ----
  408. X       *score;
  409. X  char keys[10];
  410. X  {
  411. X! int  x,y,sx=0,sy=0,quit=0,nx,ny,nosave =0;
  412. X  char (*frow)[ROWLEN+1] = screen,
  413. X       ch;
  414. X  char buffer[50];
  415. X***************
  416. X*** 107,116 ****
  417. X      }
  418. X  else if(ch == 'q')
  419. X      {
  420. X!     move(19,0);
  421. X!     addstr("                                                                          ");
  422. X      break;
  423. X      }
  424. X  else if(ch == 'm')              /* change to number of moves for the screen */
  425. X      {
  426. X      move(19,0);
  427. X--- 112,141 ----
  428. X      }
  429. X  else if(ch == 'q')
  430. X      {
  431. X!     noins();
  432. X      break;
  433. X      }
  434. X+ else if(ch == 'x')
  435. X+     {
  436. X+     noins();
  437. X+     move(20,0);
  438. X+     addstr("You will lose any changes made this session - sre you sure? (y/n)");
  439. X+     refresh();
  440. X+     ch = getch();
  441. X+     if(ch != 'y')
  442. X+     {
  443. X+     noins();
  444. X+     instruct();
  445. X+     refresh();
  446. X+         }
  447. X+     else
  448. X+     {
  449. X+     nosave = 1;
  450. X+     addstr("\n");
  451. X+     refresh();
  452. X+     break;
  453. X+         }
  454. X+     }
  455. X  else if(ch == 'm')              /* change to number of moves for the screen */
  456. X      {
  457. X      move(19,0);
  458. X***************
  459. X*** 132,138 ****
  460. X  else if(ch == 'p' || ch == 'n')       /* play the game (test) */
  461. X      {
  462. X      noins();
  463. X!     wscreen(num,maxmoves);
  464. X      if(ch == 'p')
  465. X          {
  466. X          debug_disp = 0;
  467. X--- 157,163 ----
  468. X  else if(ch == 'p' || ch == 'n')       /* play the game (test) */
  469. X      {
  470. X      noins();
  471. X!         wscreen(num,maxmoves);
  472. X      if(ch == 'p')
  473. X          {
  474. X          debug_disp = 0;
  475. X***************
  476. X*** 181,192 ****
  477. X  y=ny;
  478. X  }
  479. X  
  480. X! for(y = 0; y<NOOFROWS;y++)       /* certain editors - eg ded - have a */
  481. X!                      /* habit of truncating trailing spaces*/
  482. X!                          /* so this should stop them! */
  483. X!     if(screen[y][ROWLEN-1] == ' ')
  484. X!     screen[y][ROWLEN-1] = '-';
  485. X! wscreen(num,maxmoves);
  486. X  move(20,0);
  487. X  refresh();
  488. X  }
  489. X--- 206,221 ----
  490. X  y=ny;
  491. X  }
  492. X  
  493. X! if(! nosave)
  494. X!     {
  495. X!     for(y = 0; y<=NOOFROWS;y++) /* certain editors - eg ded - have a */
  496. X!                                 /* habit of truncating trailing spaces*/
  497. X!                             /* so this should stop them! */
  498. X!         if(screen[y][ROWLEN-1] == ' ')
  499. X!         screen[y][ROWLEN-1] = '-';
  500. X!     wscreen(num,maxmoves);
  501. X!     }
  502. X! noins();
  503. X  move(20,0);
  504. X  refresh();
  505. X  }
  506. X*** fall.c.orig    Tue Nov 29 16:43:09 1988
  507. X--- fall.c    Tue Nov 29 16:44:26 1988
  508. X***************
  509. X*** 26,36 ****
  510. X  int  x,y,sx,sy, *mx, *my;
  511. X  char howdead[25];
  512. X  {
  513. X! int nx = x,nyl = y,nyr = y,retval = 0;
  514. X  if ((y>(NOOFROWS-1))||(y<0)||(x<0)||(x>(ROWLEN-1)))
  515. X      return(0);
  516. X  if((screen[y][x] != 'O') && (screen[y][x] != ' ') && (screen[y][x] != 'M') &&
  517. X!    (screen[y][x] !='\\') && (screen[y][x] != '/') && (screen[y][x] != '@'))
  518. X      return(0);
  519. X  if(screen[y][x] == 'O')
  520. X      {
  521. X--- 26,37 ----
  522. X  int  x,y,sx,sy, *mx, *my;
  523. X  char howdead[25];
  524. X  {
  525. X! int nx = x,nxu = x,nyl = y,nyr = y,retval = 0;
  526. X  if ((y>(NOOFROWS-1))||(y<0)||(x<0)||(x>(ROWLEN-1)))
  527. X      return(0);
  528. X  if((screen[y][x] != 'O') && (screen[y][x] != ' ') && (screen[y][x] != 'M') &&
  529. X!    (screen[y][x] !='\\') && (screen[y][x] != '/') && (screen[y][x] != '@') &&
  530. X!    (screen[y][x] != '^'))
  531. X      return(0);
  532. X  if(screen[y][x] == 'O')
  533. X      {
  534. X***************
  535. X*** 43,48 ****
  536. X--- 44,58 ----
  537. X      else
  538. X          nx = -1;
  539. X      }
  540. X+     if((screen[y][x-1] == ' ') && (screen[y+1][x-1] == ' '))
  541. X+         nxu--;
  542. X+     else
  543. X+     {
  544. X+         if((screen[y][x+1] == ' ') && (screen[y+1][x+1] == ' '))
  545. X+             nxu++;
  546. X+     else
  547. X+         nxu = -1;
  548. X+     }
  549. X      if((screen[y-1][x] == ' ') && (screen[y-1][x+1] == ' '))
  550. X          nyr--;
  551. X      else
  552. X***************
  553. X*** 66,71 ****
  554. X--- 76,83 ----
  555. X      {
  556. X      if(screen[y-1][++nx] != ' ')
  557. X      nx = -1;
  558. X+     if(screen[y+1][--nxu] != ' ')
  559. X+         nxu = -1;
  560. X      if(screen[--nyr][x+1] != ' ')
  561. X          nyr = -1;
  562. X      if(screen[++nyl][x-1] != ' ')
  563. X***************
  564. X*** 75,80 ****
  565. X--- 87,94 ----
  566. X      {
  567. X      if(screen[y-1][--nx] != ' ')
  568. X      nx = -1;
  569. X+     if(screen[y+1][++nxu] != ' ')
  570. X+         nxu = -1;
  571. X      if(screen[++nyr][x+1] != ' ')
  572. X      nyr = -1;
  573. X      if(screen[--nyl][x-1] != ' ')
  574. X***************
  575. X*** 82,88 ****
  576. X      }
  577. X  if((screen[y][nx] != ' ') && (screen[y][nx] != 'M'))
  578. X      nx = -1;
  579. X! if((screen[y-1][x] == 'O') && (nx >= 0) && (y > 0)) /* boulder falls ? */
  580. X      {
  581. X      screen[y-1][x] = ' ';
  582. X      if(screen[y][nx] == '@')
  583. X--- 96,103 ----
  584. X      }
  585. X  if((screen[y][nx] != ' ') && (screen[y][nx] != 'M'))
  586. X      nx = -1;
  587. X! if((screen[y-1][x] == 'O') && (nx >= 0) && (y > 0) &&
  588. X!    (screen[y][nx] != '^')) /* boulder falls ? */
  589. X      {
  590. X      screen[y-1][x] = ' ';
  591. X      if(screen[y][nx] == '@')
  592. X***************
  593. X*** 124,130 ****
  594. X      screen[y+1][nx] = ' ';
  595. X          }
  596. X      }
  597. X! if((screen[nyr][x] != ' ')&&(screen[nyr][x] != 'M'))
  598. X      nyr = -1;
  599. X  if((screen[y][x+1] == '<')&&(nyr>=0)&&(x+1<ROWLEN)) /* arrow moves ( < ) ? */
  600. X      {
  601. X--- 139,145 ----
  602. X      screen[y+1][nx] = ' ';
  603. X          }
  604. X      }
  605. X! if((screen[nyr][x] != '^')&&(screen[nyr][x] != ' ')&&(screen[nyr][x] != 'M'))
  606. X      nyr = -1;
  607. X  if((screen[y][x+1] == '<')&&(nyr>=0)&&(x+1<ROWLEN)) /* arrow moves ( < ) ? */
  608. X      {
  609. X***************
  610. X*** 168,174 ****
  611. X      screen[nyr][x-1] = ' ';
  612. X          }
  613. X      }
  614. X! if((screen[nyl][x] != ' ')&&(screen[nyl][x] != 'M'))
  615. X      nyl = -1;
  616. X  if((screen[y][x-1] == '>')&&(nyl>=0)&&(x>0))       /* arrow moves ( > ) ? */
  617. X      {
  618. X--- 183,189 ----
  619. X      screen[nyr][x-1] = ' ';
  620. X          }
  621. X      }
  622. X! if((screen[nyl][x] != ' ')&&(screen[nyl][x] != '^')&&(screen[nyl][x] != 'M'))
  623. X      nyl = -1;
  624. X  if((screen[y][x-1] == '>')&&(nyl>=0)&&(x>0))       /* arrow moves ( > ) ? */
  625. X      {
  626. X***************
  627. X*** 211,216 ****
  628. X--- 226,256 ----
  629. X          *mx = *my = -2;
  630. X      screen[nyl][x+1] = ' ';
  631. X          }
  632. X+     }
  633. X+ if(screen[y][nxu] != ' ')
  634. X+     nxu = -1;
  635. X+ if((screen[y+1][x] == '^') && (nxu >= 0) && (y < NOOFROWS) &&
  636. X+    (screen[y][x] != '^')) /* balloon rises? */
  637. X+     {
  638. X+     screen[y+1][x] = ' ';
  639. X+     screen[y][nxu] = '^';
  640. X+     if(!debug_disp)
  641. X+     {
  642. X+         if((y<(sy+3)) && (y>(sy-5)) && (x>(sx-6)) && (x<(sx+6)))
  643. X+             draw_symbol((x-sx+5)*3,(y-sy+4)*2,' ');
  644. X+         if((y<(sy+4)) && (y>(sy-4)) && (nxu>(sx-6)) && (nxu<(sx+6)))
  645. X+             draw_symbol((nxu-sx+5)*3,(y-sy+3)*2,'^');
  646. X+     }
  647. X+     else
  648. X+     {
  649. X+     move(y+2,x+1);
  650. X+     addch(' ');
  651. X+     move(y+1,nxu+1);
  652. X+     addch('^');
  653. X+     }
  654. X+     refresh();
  655. X+     retval+=fall(mx,my,nxu ,y-1,sx,sy,howdead);
  656. X+     retval+=check(mx,my,x,y+1,0,-1,sx,sy,howdead);
  657. X      }
  658. X  if(retval>0)
  659. X      return(1);
  660. X*** game.c.orig    Tue Nov 29 16:43:11 1988
  661. X--- game.c    Tue Nov 29 16:44:31 1988
  662. X***************
  663. X*** 1,7 ****
  664. X  #include "wand_head.h"
  665. X  
  666. X  #define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
  667. X!     (screen[y][x] == '@') || (screen[y][x] == '+')) && (y >= 0) &&\
  668. X      (x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
  669. X  
  670. X  /* typedef struct mon_rec        *//* M002 struct mon_rec moved    */
  671. X--- 1,8 ----
  672. X  #include "wand_head.h"
  673. X  
  674. X  #define viable(x,y) (((screen[y][x] == ' ') || (screen[y][x] == ':') ||\
  675. X!     (screen[y][x] == '@') || (screen[y][x] == '+') ||\
  676. X!     (screen[y][x] == 'S')) && (y >= 0) &&\
  677. X      (x >= 0) && (y < NOOFROWS) && (x < ROWLEN))
  678. X  
  679. X  /* typedef struct mon_rec        *//* M002 struct mon_rec moved    */
  680. X***************
  681. X*** 33,38 ****
  682. X--- 34,40 ----
  683. X  
  684. X  extern void map();
  685. X  
  686. X+ extern void redraw_screen();
  687. X  extern int debug_disp;
  688. X  extern int edit_mode;
  689. X  extern int saved_game;
  690. X***************
  691. X*** 131,137 ****
  692. X  {
  693. X  int  x,y,nx,ny,deadyet =0,
  694. X       sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1,
  695. X!      bx, by, nbx, nby,
  696. X       newnum,
  697. X       max_score = 250,
  698. X       diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
  699. X--- 133,139 ----
  700. X  {
  701. X  int  x,y,nx,ny,deadyet =0,
  702. X       sx = -1,sy = -1,tx = -1,ty = -1,lx = 0,ly = 0,mx = -1,my = -1,
  703. X!      bx, by, nbx, nby, tmpx,tmpy,
  704. X       newnum,
  705. X       max_score = 250,
  706. X       diamonds = 0, nf = 0,hd ,vd ,xdirection,ydirection;
  707. X***************
  708. X*** 249,261 ****
  709. X  nx=x;
  710. X  ny=y;
  711. X  
  712. X! if(ch == keys[3])              /* move about - but thats obvious */
  713. X      nx++;
  714. X! if(ch == keys[2])
  715. X      nx--;
  716. X! if((ch == keys[1]) && (y<(NOOFROWS-1)))
  717. X      ny++;
  718. X! if(ch == keys[0])
  719. X          ny--;
  720. X  if(ch == '1')                  /* Add or get rid of that awful sound */
  721. X      {
  722. X--- 251,263 ----
  723. X  nx=x;
  724. X  ny=y;
  725. X  
  726. X! if((ch == keys[3]) && (x <(ROWLEN-1)))  /* move about - but thats obvious */
  727. X      nx++;
  728. X! if((ch == keys[2]) && (x > 0))
  729. X      nx--;
  730. X! if((ch == keys[1]) && (y <(NOOFROWS-1)))
  731. X      ny++;
  732. X! if((ch == keys[0]) && (y > 0))
  733. X          ny--;
  734. X  if(ch == '1')                  /* Add or get rid of that awful sound */
  735. X      {
  736. X***************
  737. X*** 305,313 ****
  738. X--- 307,348 ----
  739. X  if(ch == '?')
  740. X      {
  741. X      helpme();
  742. X+     if(debug_disp)
  743. X+         map(frow);
  744. X+         else
  745. X+         display(sx,sy,frow,*score);
  746. X+     continue;
  747. X+     }
  748. X+ if((ch == '@')&&(!debug_disp))
  749. X+     {
  750. X+     sx = x;
  751. X+     sy = y;
  752. X      display(sx,sy,frow,*score);
  753. X      continue;
  754. X      }
  755. X+ if(ch == '#')
  756. X+     {
  757. X+     debug_disp = 1 - debug_disp;
  758. X+     if(debug_disp)
  759. X+         map(frow);
  760. X+     else
  761. X+         {
  762. X+          for(tmpy=0;tmpy<=(NOOFROWS+1);tmpy++)
  763. X+                 {
  764. X+                 move(tmpy,0);
  765. X+                 for(tmpx=0;tmpx<=(ROWLEN+2);tmpx++)
  766. X+                     addch(' ');
  767. X+             }
  768. X+         sx = x; sy = y;
  769. X+         display(sx,sy,frow,*score);
  770. X+         }
  771. X+     continue;
  772. X+     }
  773. X+ if(ch == 'W')
  774. X+     {
  775. X+         redraw_screen(maxmoves,*num,*score,nf,diamonds,mx,sx,sy,frow);
  776. X+     continue;
  777. X+     }
  778. X  
  779. X  /* M002  Added save/restore game feature.  Gregory H. Margo    */
  780. X  if(ch == 'S')           /* save game */
  781. X***************
  782. X*** 463,468 ****
  783. X--- 498,536 ----
  784. X          x = nx;
  785. X          }
  786. X      break;
  787. X+     case '^':
  788. X+     if(screen[y][nx*2-x] == ' ')
  789. X+         {
  790. X+         screen[y][nx*2-x] = '^';
  791. X+         screen[y][x] = ' ';
  792. X+             screen[ny][nx] = '@';
  793. X+         if(!debug_disp)
  794. X+         {
  795. X+                 draw_symbol((x-sx+5)*3,(y-sy+3)*2,' ');
  796. X+                 draw_symbol((nx-sx+5)*3,(ny-sy+3)*2,'@');
  797. X+         if(nx*2-x>sx-6&&nx*2-x<sx+6)
  798. X+                     draw_symbol((nx*2-x-sx+5)*3,(y-sy+3)*2,'^');
  799. X+         }
  800. X+         else
  801. X+         {
  802. X+         move(y+1,x+1);
  803. X+         addch(' ');
  804. X+         move(ny+1,nx+1);
  805. X+         addch('@');
  806. X+         move(y+1,nx*2-x+1);
  807. X+         addch('^');
  808. X+         }
  809. X+             deadyet += fall(&mx,&my,nx*2-x,y-1,sx,sy,howdead);
  810. X+             deadyet += fall(&mx,&my,x*2-nx,y,sx,sy,howdead);
  811. X+             deadyet += fall(&mx,&my,x,y,sx,sy,howdead);
  812. X+             deadyet += fall(&mx,&my,x,y+1,sx,sy,howdead);
  813. X+             deadyet += fall(&mx,&my,x,y-1,sx,sy,howdead);
  814. X+             move(16,0);
  815. X+             refresh();
  816. X+         y = ny;
  817. X+         x = nx;
  818. X+         }
  819. X+     break;
  820. X      case '<':
  821. X      case '>':
  822. X      if(screen[ny*2-y][x] == 'M')
  823. X***************
  824. X*** 718,730 ****
  825. X      refresh();
  826. X      }
  827. X  
  828. X! current = &start_of_list;
  829. X  while((current != tail_of_list)&&(!deadyet))
  830. X      /* deal with those little monsters */
  831. X      {
  832. X      monster = current->next;
  833. X      new_disp = new_direction( monster->x, monster->y, monster->mx, monster->my );
  834. X!     if(monster->under!='S')
  835. X      {
  836. X          screen[monster->y][monster->x] = monster->under;
  837. X          if(!debug_disp)
  838. X--- 786,798 ----
  839. X      refresh();
  840. X      }
  841. X  
  842. X! current = &start_of_list;                         /* baby monsters now */
  843. X  while((current != tail_of_list)&&(!deadyet))
  844. X      /* deal with those little monsters */
  845. X      {
  846. X      monster = current->next;
  847. X      new_disp = new_direction( monster->x, monster->y, monster->mx, monster->my );
  848. X!     if(monster->under!='S')             /* if on top of another baby */
  849. X      {
  850. X          screen[monster->y][monster->x] = monster->under;
  851. X          if(!debug_disp)
  852. X*** help.c.orig    Tue Nov 29 16:43:21 1988
  853. X--- help.c    Tue Nov 29 16:44:35 1988
  854. X***************
  855. X*** 10,24 ****
  856. X  " Collect all the treasure:    /$\\  ", /* 4 */
  857. X  "                              \\$/  ", /* 5 */
  858. X  " Then go through the exit:    Way  ", /* 6 */
  859. X! " Default keys are:            out  ", /* 7 */
  860. X  "  h  Left       j  Down            ", /* 8 */
  861. X  "  k  Up         l  Right           ", /* 9 */
  862. X  "  1  Loud       q  Quit game       ", /* 10 */
  863. X  "  0  Quiet      !  Look at map     ", /* 11 */
  864. X  "  S  Save game  R  Restore Game    ", /* 12 */
  865. X! "  ?  Enter help mode               ", /* 13 */
  866. X! "  ~  Jump to next level            ", /* 14 */
  867. X! "     (does not receive level bonus)", /* 15 */
  868. X  
  869. X  "This is you:  You are a spider.    ", /* 0 */
  870. X  "      o       (At least, that's    ", /* 1 */
  871. X--- 10,24 ----
  872. X  " Collect all the treasure:    /$\\  ", /* 4 */
  873. X  "                              \\$/  ", /* 5 */
  874. X  " Then go through the exit:    Way  ", /* 6 */
  875. X! "                              out  ", /* 7 */
  876. X  "  h  Left       j  Down            ", /* 8 */
  877. X  "  k  Up         l  Right           ", /* 9 */
  878. X  "  1  Loud       q  Quit game       ", /* 10 */
  879. X  "  0  Quiet      !  Look at map     ", /* 11 */
  880. X  "  S  Save game  R  Restore Game    ", /* 12 */
  881. X! "  ?  Help mode  @  Center screen   ", /* 13 */
  882. X! "  ~  Jump level #  Switch mode     ", /* 14 */
  883. X! " nb: No level bonus for jumping.   ", /* 15 */
  884. X  
  885. X  "This is you:  You are a spider.    ", /* 0 */
  886. X  "      o       (At least, that's    ", /* 1 */
  887. X***************
  888. X*** 58,65 ****
  889. X  "is captured and you get 50 points. ", /* 1 */
  890. X  "The cage also becomes a diamond.   ", /* 2 */
  891. X  "                                   ", /* 3 */
  892. X! " !!! and  I  Instant annihilation  ", /* 4 */
  893. X! " !!!      o                        ", /* 5 */
  894. X  "                                   ", /* 6 */
  895. X  " \\_       _/   Slopes (boulders    ", /* 7 */
  896. X  "   \\ and /     and etc slide off)  ", /* 8 */
  897. X--- 58,65 ----
  898. X  "is captured and you get 50 points. ", /* 1 */
  899. X  "The cage also becomes a diamond.   ", /* 2 */
  900. X  "                                   ", /* 3 */
  901. X! "  I   Instant annihilation         ", /* 4 */
  902. X! "  o                                ", /* 5 */
  903. X  "                                   ", /* 6 */
  904. X  " \\_       _/   Slopes (boulders    ", /* 7 */
  905. X  "   \\ and /     and etc slide off)  ", /* 8 */
  906. X***************
  907. X*** 70,75 ****
  908. X--- 70,91 ----
  909. X  "                                   ", /* 3 */
  910. X  " Way  Exit -- Must Collect all the ", /* 4 */
  911. X  " out  treasure first. (250 bonus)  ", /* 5 */
  912. X+ " /~\\  A new addition for version   ", /* 0 */
  913. X+ " \\_X  2.2M . The balloon rises,    ", /* 1 */
  914. X+ "      and is popped by arrows. It  ", /* 2 */
  915. X+ "      does *not* kill you.         ", /* 3 */
  916. X+ "                                   ", /* 4 */
  917. X+ " OOO  Unrecognised symbol in map.  ", /* 5 */
  918. X+ " OOO  This is probably a **bug** ! ", /* 6 */
  919. X+ "                                   ", /* 7 */
  920. X+ " ENVIRONMENT VARIABLES:            ", /* 8 */
  921. X+ "                                   ", /* 9 */
  922. X+ "   NEWNAME,NAME : Checked in that  ", /* 0 */
  923. X+ "       order for the hiscore table ", /* 1 */
  924. X+ "   NEWKEYS : Redefine movement keys", /* 2 */
  925. X+ "       eg- 'hlkj' for default      ", /* 3 */
  926. X+ "   SAVENAME : File used for saved  ", /* 4 */
  927. X+ "       games.                      ", /* 5 */
  928. X  };
  929. X  
  930. X  
  931. X***************
  932. X*** 81,87 ****
  933. X      char *ptr;  /* pointer in array.. */
  934. X      char ch;
  935. X  
  936. X!     for(i1 = 0; i1 < 4; i1++)  /* times to show loop. */
  937. X      {
  938. X          for(i = 0; i < 16; i++)    /* show one menu. */
  939. X          {
  940. X--- 97,103 ----
  941. X      char *ptr;  /* pointer in array.. */
  942. X      char ch;
  943. X  
  944. X!     for(i1 = 0; i1 < 5; i1++)  /* times to show loop. */
  945. X      {
  946. X          for(i = 0; i < 16; i++)    /* show one menu. */
  947. X          {
  948. X*** icon.c.orig    Tue Nov 29 16:43:22 1988
  949. X--- icon.c    Tue Nov 29 16:44:40 1988
  950. X***************
  951. X*** 9,83 ****
  952. X           (*iconrow)[4] = icon;
  953. X      switch(ch)
  954. X      {
  955. X!     case ' ':
  956. X!         strcpy((*iconrow++),"   ");
  957. X!         strcpy((*iconrow),"   ");
  958. X          break;
  959. X!     case '#':
  960. X          strcpy(*iconrow++,"###");
  961. X!         strcpy(*iconrow,"###");
  962. X          break;
  963. X!     case '<':
  964. X          strcpy(*iconrow++,"<--");
  965. X!         strcpy(*iconrow,"<--");
  966. X          break;
  967. X      case '>':
  968. X          strcpy(*iconrow++,"-->");
  969. X!         strcpy(*iconrow,"-->");
  970. X          break;
  971. X!     case 'O':
  972. X          strcpy(*iconrow++,"/^\\");
  973. X!         strcpy(*iconrow,"\\_/");
  974. X          break;
  975. X!     case ':':
  976. X          strcpy(*iconrow++,". .");
  977. X!         strcpy(*iconrow," . ");
  978. X          break;
  979. X!     case '/':
  980. X          strcpy(*iconrow++," _/");
  981. X!         strcpy(*iconrow,"/  ");
  982. X          break;
  983. X      case '\\':
  984. X          strcpy(*iconrow++,"\\_ ");
  985. X!         strcpy(*iconrow,"  \\");
  986. X          break;
  987. X!     case '*':
  988. X          strcpy(*iconrow++,"/$\\");
  989. X!         strcpy(*iconrow, "\\$/");
  990. X          break;
  991. X!     case '=':
  992. X          strcpy(*iconrow++,"=-=");
  993. X          strcpy(*iconrow,  "-=-");
  994. X          break;
  995. X!     case '@':
  996. X          strcpy(*iconrow++," o ");
  997. X          strcpy(*iconrow,  "<|>");
  998. X          break;
  999. X!     case 'T':
  1000. X          strcpy(*iconrow++,"(*)");
  1001. X          strcpy(*iconrow,  "(*)");
  1002. X          break;
  1003. X!     case 'X':
  1004. X          strcpy(*iconrow++,"Way");
  1005. X          strcpy(*iconrow,  "Out");
  1006. X          break;
  1007. X!     case '!':
  1008. X          strcpy(*iconrow++," I ");
  1009. X          strcpy(*iconrow,  " o ");
  1010. X          break;
  1011. X!     case 'M':
  1012. X          strcpy(*iconrow++,"}o{");
  1013. X          strcpy(*iconrow,  "/^\\");
  1014. X          break;
  1015. X!     case 'S':
  1016. X          strcpy(*iconrow++,"-o-");
  1017. X          strcpy(*iconrow,  "/*\\");
  1018. X          break;
  1019. X!     case 'C':
  1020. X          strcpy(*iconrow++,"   ");
  1021. X          strcpy(*iconrow,  "<O>");
  1022. X          break;
  1023. X!     case '+':
  1024. X          strcpy(*iconrow++,"TTT");
  1025. X          strcpy(*iconrow,  "III");
  1026. X          break;
  1027. X--- 9,87 ----
  1028. X           (*iconrow)[4] = icon;
  1029. X      switch(ch)
  1030. X      {
  1031. X!     case ' ':                    /*  space  */
  1032. X!         strcpy(*iconrow++,"   ");
  1033. X!         strcpy(*iconrow,  "   ");
  1034. X          break;
  1035. X!     case '#':                   /*  rock  */
  1036. X          strcpy(*iconrow++,"###");
  1037. X!         strcpy(*iconrow,  "###");
  1038. X          break;
  1039. X!     case '<':                   /*  arrows  */
  1040. X          strcpy(*iconrow++,"<--");
  1041. X!         strcpy(*iconrow,  "<--");
  1042. X          break;
  1043. X      case '>':
  1044. X          strcpy(*iconrow++,"-->");
  1045. X!         strcpy(*iconrow,  "-->");
  1046. X          break;
  1047. X!     case 'O':                    /* boulder  */
  1048. X          strcpy(*iconrow++,"/^\\");
  1049. X!         strcpy(*iconrow,  "\\_/");
  1050. X          break;
  1051. X!     case ':':                    /*  earth  */
  1052. X          strcpy(*iconrow++,". .");
  1053. X!         strcpy(*iconrow,  " . ");
  1054. X          break;
  1055. X!     case '/':                    /*  slopes */
  1056. X          strcpy(*iconrow++," _/");
  1057. X!         strcpy(*iconrow,  "/  ");
  1058. X          break;
  1059. X      case '\\':
  1060. X          strcpy(*iconrow++,"\\_ ");
  1061. X!         strcpy(*iconrow,  "  \\");
  1062. X          break;
  1063. X!     case '*':                     /*  diamond  */
  1064. X          strcpy(*iconrow++,"/$\\");
  1065. X!         strcpy(*iconrow,  "\\$/");
  1066. X          break;
  1067. X!     case '=':                     /*  rock  */
  1068. X          strcpy(*iconrow++,"=-=");
  1069. X          strcpy(*iconrow,  "-=-");
  1070. X          break;
  1071. X!     case '@':                     /*  YOU!!! */
  1072. X          strcpy(*iconrow++," o ");
  1073. X          strcpy(*iconrow,  "<|>");
  1074. X          break;
  1075. X!     case 'T':                   /*  teleport  */
  1076. X          strcpy(*iconrow++,"(*)");
  1077. X          strcpy(*iconrow,  "(*)");
  1078. X          break;
  1079. X!     case 'X':                    /*  exits  */
  1080. X          strcpy(*iconrow++,"Way");
  1081. X          strcpy(*iconrow,  "Out");
  1082. X          break;
  1083. X!     case '!':                    /*  landmine  */
  1084. X          strcpy(*iconrow++," I ");
  1085. X          strcpy(*iconrow,  " o ");
  1086. X          break;
  1087. X!     case 'M':                     /* big monster  */
  1088. X          strcpy(*iconrow++,"}o{");
  1089. X          strcpy(*iconrow,  "/^\\");
  1090. X          break;
  1091. X!     case 'S':                     /* baby monster */
  1092. X          strcpy(*iconrow++,"-o-");
  1093. X          strcpy(*iconrow,  "/*\\");
  1094. X          break;
  1095. X!     case '^':             /* balloon */
  1096. X!         strcpy(*iconrow++,"/~\\");
  1097. X!         strcpy(*iconrow,  "\\_X");
  1098. X!         break;
  1099. X!     case 'C':                    /* time capsule */
  1100. X          strcpy(*iconrow++,"   ");
  1101. X          strcpy(*iconrow,  "<O>");
  1102. X          break;
  1103. X!     case '+':                    /* cage */
  1104. X          strcpy(*iconrow++,"TTT");
  1105. X          strcpy(*iconrow,  "III");
  1106. X          break;
  1107. X*** m.c.orig    Tue Nov 29 16:43:23 1988
  1108. X--- m.c    Tue Nov 29 16:44:52 1988
  1109. X***************
  1110. X*** 12,17 ****
  1111. X--- 12,18 ----
  1112. X  char screen[NOOFROWS][ROWLEN+1];
  1113. X  int edit_mode = 0;
  1114. X  int saved_game = 0;
  1115. X+ char *edit_screen;
  1116. X  
  1117. X  main(argc,argv)
  1118. X  int  argc;
  1119. X***************
  1120. X*** 28,33 ****
  1121. X--- 29,35 ----
  1122. X      if(!strcmp(argv[1], "-e"))
  1123. X      {
  1124. X      edit_mode = 1;
  1125. X+     edit_screen = NULL;
  1126. X      }
  1127. X      else if(!strcmp(argv[1], "-m"))
  1128. X      {
  1129. X***************
  1130. X*** 58,71 ****
  1131. X      }
  1132. X      else
  1133. X      {
  1134. X!     fprintf(stderr,"Usage: %s [ -e | -m | -c | -s | -f ]\n",argv[0]);
  1135. X      exit(1);
  1136. X          }
  1137. X      }
  1138. X  if(argc > 2)
  1139. X      {
  1140. X!     fprintf(stderr,"Usage: %s [ -e | -m | -c | -s | -f ]\n",argv[0]);
  1141. X!     exit(1);
  1142. X      }
  1143. X  
  1144. X  /* check for passwords - if file no_pws is in screen dir no pws! */
  1145. X--- 60,81 ----
  1146. X      }
  1147. X      else
  1148. X      {
  1149. X!     fprintf(stderr,"Usage: %s [ -e [ file ] | -m | -c | -s | -f ]\n",argv[0]);
  1150. X      exit(1);
  1151. X          }
  1152. X      }
  1153. X  if(argc > 2)
  1154. X      {
  1155. X!     if(!strcmp(argv[1],"-e"))
  1156. X!     {
  1157. X!     edit_mode = 1;
  1158. X!     edit_screen = argv[2];
  1159. X!     }
  1160. X!     else
  1161. X!     {
  1162. X!         fprintf(stderr,"Usage: %s [ -e [ file ] | -m | -c | -s | -f ]\n",argv[0]);
  1163. X!         exit(1);
  1164. X!     }
  1165. X      }
  1166. X  
  1167. X  /* check for passwords - if file no_pws is in screen dir no pws! */
  1168. X*** read.c.orig    Tue Nov 29 16:43:13 1988
  1169. X--- read.c    Tue Nov 29 16:44:55 1988
  1170. X***************
  1171. X*** 1,6 ****
  1172. X--- 1,7 ----
  1173. X  #include "wand_head.h"
  1174. X  
  1175. X  extern int edit_mode;
  1176. X+ extern char *edit_screen;
  1177. X  extern char screen[NOOFROWS][ROWLEN+1];
  1178. X  
  1179. X  int rscreen(num,maxmoves)
  1180. X***************
  1181. X*** 13,22 ****
  1182. X  if(!edit_mode)
  1183. X      sprintf(name,"%s/screen.%d",SCREENPATH,num);
  1184. X  else
  1185. X!     sprintf(name,"./screen");
  1186. X  fp = fopen(name,"r");
  1187. X  if(fp == NULL)
  1188. X!     printf("\nFile for screen %d unavailable.\n\n",num) ;
  1189. X  else
  1190. X      {
  1191. X      for(y = 0;y<NOOFROWS;y++)
  1192. X--- 14,33 ----
  1193. X  if(!edit_mode)
  1194. X      sprintf(name,"%s/screen.%d",SCREENPATH,num);
  1195. X  else
  1196. X!     {
  1197. X!     if(!edit_screen)
  1198. X!         sprintf(name,"./screen");
  1199. X!     else
  1200. X!     sprintf(name,"%s",edit_screen);
  1201. X!     }
  1202. X  fp = fopen(name,"r");
  1203. X  if(fp == NULL)
  1204. X!     {
  1205. X!     if(edit_mode)
  1206. X!     printf("\nCannot find file %s.\n\n",name);
  1207. X!     else
  1208. X!         printf("\nFile for screen %d unavailable.\n\n",num) ;
  1209. X!     }
  1210. X  else
  1211. X      {
  1212. X      for(y = 0;y<NOOFROWS;y++)
  1213. X***************
  1214. X*** 36,43 ****
  1215. X  {
  1216. X  int  y,x;
  1217. X  FILE *fp;
  1218. X  char (*row_ptr)[ROWLEN+1] = screen;
  1219. X! fp = fopen("./screen","w");
  1220. X  if(fp == NULL)
  1221. X      printf("\nFile for screen cannot be written.\n\n") ;
  1222. X  else
  1223. X--- 47,68 ----
  1224. X  {
  1225. X  int  y,x;
  1226. X  FILE *fp;
  1227. X+ char name[50];
  1228. X  char (*row_ptr)[ROWLEN+1] = screen;
  1229. X! if(!edit_screen)
  1230. X!     sprintf(name,"./screen");
  1231. X! else
  1232. X!     sprintf(name,"%s",edit_screen);
  1233. X! fp = fopen(name,"w");
  1234. X! if(fp == NULL)
  1235. X!     {
  1236. X!     sprintf(name,"/tmp/screen.%d",getpid());
  1237. X!     fp = fopen(name,"w");
  1238. X!     move(21,0);
  1239. X!     addstr("Written file is ");
  1240. X!     addstr(name);
  1241. X!     refresh();
  1242. X!     }
  1243. X  if(fp == NULL)
  1244. X      printf("\nFile for screen cannot be written.\n\n") ;
  1245. X  else
  1246. X*** save.c.orig    Tue Nov 29 16:43:25 1988
  1247. X--- save.c    Tue Nov 29 16:45:02 1988
  1248. X***************
  1249. X*** 1,8 ****
  1250. X--- 1,10 ----
  1251. X  #include "wand_head.h"
  1252. X+ #include <errno.h>
  1253. X  
  1254. X  extern char screen[NOOFROWS][ROWLEN+1];
  1255. X  extern int saved_game;
  1256. X  
  1257. X+ extern void crypt_file();
  1258. X  struct    saved_game    {
  1259. X      short    num;
  1260. X      short    score;
  1261. X***************
  1262. X*** 37,43 ****
  1263. X          gets(fp);
  1264. X      }
  1265. X      if ((FILE *)NULL == (fo = fopen(fp, W_BIN))) {
  1266. X!         printf("Open error on '%s'n", fp);
  1267. X          exit(1);
  1268. X      }
  1269. X  
  1270. X--- 39,45 ----
  1271. X          gets(fp);
  1272. X      }
  1273. X      if ((FILE *)NULL == (fo = fopen(fp, W_BIN))) {
  1274. X!         perror(fp);
  1275. X          exit(1);
  1276. X      }
  1277. X  
  1278. X***************
  1279. X*** 76,82 ****
  1280. X      }
  1281. X  
  1282. X      fclose(fo);
  1283. X! 
  1284. X      exit(0);
  1285. X  }
  1286. X  
  1287. X--- 78,86 ----
  1288. X      }
  1289. X  
  1290. X      fclose(fo);
  1291. X! #ifndef NO_ENCRYPTION
  1292. X!     crypt_file(fp,0);   /* encrpyt the saved game */
  1293. X! #endif
  1294. X      exit(0);
  1295. X  }
  1296. X  
  1297. X***************
  1298. X*** 103,112 ****
  1299. X      }
  1300. X      clear();
  1301. X      refresh();
  1302. X! 
  1303. X      if ((FILE *)NULL == (fi = fopen(fp, R_BIN))) {
  1304. X          endwin();
  1305. X!         printf("Open error on '%s'n", fp);
  1306. X          exit(1);
  1307. X      }
  1308. X      if ( (1 != fread((char *)&s, sizeof(s), 1, fi)) ||
  1309. X--- 107,119 ----
  1310. X      }
  1311. X      clear();
  1312. X      refresh();
  1313. X! #ifndef NO_ENCRYPTION
  1314. X!      crypt_file(fp,1);   /*decrypt it*/
  1315. X! #endif
  1316. X      if ((FILE *)NULL == (fi = fopen(fp, R_BIN))) {
  1317. X          endwin();
  1318. X!         printf("Open error on '%s'\n", fp);
  1319. X!         printf("Cannot restore game --- sorry.\n");
  1320. X          exit(1);
  1321. X      }
  1322. X      if ( (1 != fread((char *)&s, sizeof(s), 1, fi)) ||
  1323. X***************
  1324. X*** 114,119 ****
  1325. X--- 121,127 ----
  1326. X           (1 != fread((char *)&zz, sizeof(zz), 1, fi)) ) {
  1327. X          endwin();
  1328. X          printf("Read error on '%s'n", fp);
  1329. X+         printf("Cannot restore game --- sorry.\n");
  1330. X          fclose(fi);
  1331. X          exit(1);
  1332. X      }
  1333. X***************
  1334. X*** 150,155 ****
  1335. X--- 158,164 ----
  1336. X          if ((struct mon_rec *)NULL == (mp = make_monster(0, 0))) {
  1337. X              endwin();
  1338. X              printf("Monster alloc error on '%s'n", fp);
  1339. X+                         printf("Try again - it might work.\nBut then,pigs might fly...\n");
  1340. X              fclose(fi);
  1341. X              exit(1);
  1342. X          }
  1343. X***************
  1344. X*** 156,161 ****
  1345. X--- 165,171 ----
  1346. X          if (1 != fread((char *)&tmp_monst, sizeof(struct mon_rec), 1, fi)) {
  1347. X              endwin();
  1348. X              printf("Monster read error on '%s'n", fp);
  1349. X+             printf("Cannot restore game --- sorry.\n");
  1350. X              fclose(fi);
  1351. X              exit(1);
  1352. X          }
  1353. X*** wand_head.h.orig    Tue Nov 29 16:43:17 1988
  1354. X--- wand_head.h    Tue Nov 29 16:45:09 1988
  1355. X***************
  1356. X*** 19,24 ****
  1357. X--- 19,29 ----
  1358. X  /* change the numbers in this as well, but keep it in the same form */
  1359. X  #define PASSWD (num * num * 4373 + num * 16927 + 39)
  1360. X  
  1361. X+ /* To disable the recording of hiscores from games restored from saves */
  1362. X+ /* #define NO_RESTORED_GAME_HISCORES  */
  1363. X+ /* #define COMPARE_BY_NAME  define this to compare by name, not uid */
  1364. X+ #define GUESTUID 0    /* guestuid always compared by name */
  1365. X+ /* #define NO_ENCRYPTION define this to disable the savefile encryptor */
  1366. X  /* cbreak switching via curses package. */
  1367. X  /* on some Ultrix systems you may need to use crmode() and nocrmode() */
  1368. X  /* if so, just change the #defs to the necessary. I also know that Xenix */
  1369. X***************
  1370. X*** 31,38 ****
  1371. X  #define CBOFF nocbreak()
  1372. X  #endif
  1373. X  
  1374. X- /* To disable the recording of hiscores from games restored from saves */
  1375. X- /* #define NO_RESTORED_GAME_HISCORES  */
  1376. X  
  1377. X  /* MSDOS modifications (M001) by Gregory H. Margo    */
  1378. X  #ifdef    MSDOS
  1379. X--- 36,41 ----
  1380. END_OF_FILE
  1381. if test 30930 -ne `wc -c <'patches01'`; then
  1382.     echo shar: \"'patches01'\" unpacked with wrong size!
  1383. fi
  1384. # end of 'patches01'
  1385. fi
  1386. if test -f 'screen.16' -a "${1}" != "-c" ; then 
  1387.   echo shar: Will not clobber existing file \"'screen.16'\"
  1388. else
  1389. echo shar: Extracting \"'screen.16'\" \(700 characters\)
  1390. sed "s/^X//" >'screen.16' <<'END_OF_FILE'
  1391. XX!   !!                       O OO    O-
  1392. X  *! !   O                  + =*==*=*==*
  1393. X!!!  !   *O     ! >>*              *   -
  1394. X          :\   >>>/              *     -
  1395. X    \           >/           /         -
  1396. X  :   :  :    * /    !<<    /S         -
  1397. X>>O*   :    :     /O><<<<           *  -
  1398. X##*              /*O*                  -
  1399. X    *      #*####  O*      !###        -
  1400. X*          #    # \*      !##O#        -
  1401. X        \O ###\<<<<\     !##O<##       -
  1402. X *<      \:::  #*##     !#*#O          -
  1403. X ====     ####  ##     !#CC#*        ===
  1404. X =  =  C   : ###      !#CCC#/       *<=M
  1405. X  = =  *  @:   :     !#CC        /=====-
  1406. X+ S *      :   :    !*CC    /    *     -
  1407. X########################################
  1408. X50
  1409. END_OF_FILE
  1410. if test 700 -ne `wc -c <'screen.16'`; then
  1411.     echo shar: \"'screen.16'\" unpacked with wrong size!
  1412. fi
  1413. # end of 'screen.16'
  1414. fi
  1415. if test -f 'screen.21' -a "${1}" != "-c" ; then 
  1416.   echo shar: Will not clobber existing file \"'screen.21'\"
  1417. else
  1418. echo shar: Extracting \"'screen.21'\" \(697 characters\)
  1419. sed "s/^X//" >'screen.21' <<'END_OF_FILE'
  1420. X*!>>O           \*OOOOO />O   \#T#X#O#O*
  1421. X  O ::!:::::::O  \OOOOO/:#*    #   ::::<
  1422. X#>: ::::::!#>#:   \OOO/::# # # *## ###O#
  1423. X####::#>*  \:      \O/  =# # #===# ## :#
  1424. X*             \    :<#  #  ::      #O :<
  1425. X###O/###########    /#     ##! ==###: A#
  1426. X#O#>>>>>>>>>: *#      >>:   #  #:::::#*#
  1427. X>*        *= O##   \    ## ## !#:######*
  1428. X#    ##### ! :<#         # !#  #    / :<
  1429. X== =O   !>:  :=#    /   *< =# ><  O  @ #
  1430. XO<#O:        =*          # !# =#= ======
  1431. X*::   #!!!!!  =#   \       =#  O#     :<
  1432. X############# =#O          !#! ::==== !*
  1433. X >:             :   / #     ##        !-
  1434. X## #         ####     #  #   =========!-
  1435. X*  #!!!!!!!!!*::::#*# # #*>:           -
  1436. X########################################
  1437. END_OF_FILE
  1438. if test 697 -ne `wc -c <'screen.21'`; then
  1439.     echo shar: \"'screen.21'\" unpacked with wrong size!
  1440. fi
  1441. # end of 'screen.21'
  1442. fi
  1443. if test -f 'screen.22' -a "${1}" != "-c" ; then 
  1444.   echo shar: Will not clobber existing file \"'screen.22'\"
  1445. else
  1446. echo shar: Extracting \"'screen.22'\" \(697 characters\)
  1447. sed "s/^X//" >'screen.22' <<'END_OF_FILE'
  1448. X*    O    <*  \OOOOOO*/      #O*   <<<<<
  1449. X####:####=== O \OOOOO/       #*:    <<<<
  1450. X#            :  \OOO/        # #*    <<<
  1451. X##OO    @  ##/  <*O/         #  #*    <<
  1452. X*A::  =======     :  ###     *:  *#    <
  1453. X#####             \  #*>    /          *
  1454. X          =O  =:===# ###  \    /       -
  1455. X   /     <>*     X #       \  /OO  !!! -
  1456. X*         =O  O!===#        =*=*>   *! -
  1457. X>       \ ::::::            === *  !!! -
  1458. X>>       \               \      \      -
  1459. X>>>         \                    \  ###-
  1460. X>>>>   OOOO    *                  \ **#-
  1461. X>>>>>           \  # \  /  ====   ==###-
  1462. X::*:*           *# # # #             ===
  1463. X*  *  *=**=*>   *#*#*#T#>*  *  <*!!!   *
  1464. X########################################
  1465. END_OF_FILE
  1466. if test 697 -ne `wc -c <'screen.22'`; then
  1467.     echo shar: \"'screen.22'\" unpacked with wrong size!
  1468. fi
  1469. # end of 'screen.22'
  1470. fi
  1471. if test -f 'screen.23' -a "${1}" != "-c" ; then 
  1472.   echo shar: Will not clobber existing file \"'screen.23'\"
  1473. else
  1474. echo shar: Extracting \"'screen.23'\" \(697 characters\)
  1475. sed "s/^X//" >'screen.23' <<'END_OF_FILE'
  1476. X/ *=                         #*   ^O</T<
  1477. X  == :O O O O  O O O O       ###+\^^  :^
  1478. X      ^*::**:  **:**:*   OO          /^#
  1479. X>*            /          */            -
  1480. X^/          \      OO        #         -
  1481. X*\           *  / ##:*<<\    S         -
  1482. X:=>:           O\ ^^:*<</              -
  1483. X*/             *<X  @< /               -
  1484. X/  O/\         ^/ \#^#/    / +         -
  1485. X  */ A\        /S  #*#    /            -
  1486. X O/    \      /*  *\#/:                -
  1487. X*/      \    /  **    :                -
  1488. X/        \  /      :::                ==
  1489. X==       =====*==*:                 ==S-
  1490. X*        ^ ^ ^ ^ ^               ====* -
  1491. X+=\            ^                *<<<<<<<
  1492. X########################################
  1493. END_OF_FILE
  1494. if test 697 -ne `wc -c <'screen.23'`; then
  1495.     echo shar: \"'screen.23'\" unpacked with wrong size!
  1496. fi
  1497. # end of 'screen.23'
  1498. fi
  1499. echo shar: End of shell archive.
  1500. exit 0
  1501.